﻿/*----------------------------------------------------------------
//  <copyright file="IVerifyCodeService.cs" company="MicroCloud@151504200868">
//      Copyright © 2020-2024 MicroCloud Corporation, All rights reserved.
//  </copyright>
//  <site>https://gitee.com/chenmm123/microclouds</site>
//  <last-editor>cmm</last-editor>
//  <last-date>2021-11-19 12:31</last-date>
//----------------------------------------------------------------*/

namespace MicroCloud.AspNetCore.VerifyCode
{
    #region "验证码处理功能接口"
    /// <summary>
    /// 验证码处理功能接口
    /// </summary>
    public interface IVerifyCodeService
    {
        #region "方法"
        #region "校验验证码有效性"
        /// <summary>
        /// 校验验证码有效性
        /// </summary>
        /// <param name="code">要校验的验证码</param>
        /// <param name="id">验证码编号</param>
        /// <param name="removeIfSuccess">验证成功时是否移除</param>
        /// <returns></returns>
        bool CheckCode(string code, string id, bool removeIfSuccess = true);
        #endregion
        #region "设置验证码到Session中"
        /// <summary>
        /// 设置验证码到Session中
        /// </summary>
        /// <param name="code"></param>
        /// <param name="seconds"></param>
        string SetCode(string code, int seconds = 60 * 3);
        #endregion

        #endregion

    }
    #endregion

}
